package com.time.sky.mapper;

import com.time.sky.entity.SM;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface SMMapper {
    @Select("SELECT * FROM SM s LEFT JOIN uinfo u ON s.uid=u.uid left join binfo b on s.bid = b.bid")
    List<SM> selectList();
    @Insert("insert into SM(sname,uid) " +
            "values(#{sname},#{uid})")
    void add(SM sm);
    @Delete("delete from SM where sid=#{sid}")
    void delete(int sid);
    @Select("SELECT * FROM SM  where sid=#{sid}")
    SM getById(int sid);
    @Update("update SM set sname=#{sname},uid=#{uid} where sid=#{sid}")
    void update(SM sm);

}
